import request from "@/utils/http";
import type { MyFileQuery, MyFileVO, MyFilePageResult } from "./types";

/**
 * 上传
 *
 * @param queryParams
 */
export function uploadMyFile(formData?: FormData) {
  return request({
    url: "/file/my-file/upload",
    method: "POST",
    data: formData,
    header: {
      "Content-Type": "multipart/form-data",
    },
  });
}

/**
 * 分页
 *
 * @param queryParams
 */
export function getMyFilePage(
  queryParams?: MyFileQuery
): Promise<Result<MyFilePageResult>> {
  return request<MyFilePageResult>({
    url: "/file/my-file/page",
    method: "GET",
    data: queryParams,
  });
}
